#include "ros/ros.h"
#include "turtle_move/move.h"
int main(int argc, char *argv[])
{
    setlocale(LC_ALL, "");


    ros::init(argc, argv, "Move_Client");

    ros::NodeHandle nh;

    ros::ServiceClient client = nh.serviceClient<turtle_move::move>("Move_Server");

    ros::service::waitForService("Move_Server");

    turtle_move::move ai;
    ai.request.x = atof(argv[1]);
    ai.request.y = atof(argv[2]);

    bool flag = client.call(ai);
    // 7.处理响应
    if (flag)
    {
        ROS_INFO("请求正常处理,当前坐标: (%lf, %lf)", ai.response.x, ai.response.y);
    }
    else
    {
        ROS_ERROR("请求处理失败....");
        return 1;
    }
    return 0;
}
